package hy.iot.core.exception;

public class IotFieldException extends RuntimeException{

    private int code;
    private String message;
    private String detailsMsg;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getDetailsMsg() {
        return detailsMsg;
    }

    public void setDetailsMsg(String detailsMsg) {
        this.detailsMsg = detailsMsg;
    }

    public IotFieldException(int code, String message) {
        super(code+" "+message);
        this.code = code;
        this.message = message;
    }

    public IotFieldException(IotBaseException code) {
        super(code.getCode()+" "+code.getMessage());
        this.code = code.getCode();
        this.message = code.getMessage();
    }
    public IotFieldException(IotBaseException code,String detailsMsg) {
        super(code.getCode()+" "+code.getMessage()+" "+detailsMsg);
        this.code = code.getCode();
        this.message = code.getMessage();
    }

    @Override
    public String toString() {
        return "IotFieldException{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", detailsMsg='" + detailsMsg + '\'' +
                '}';
    }
}
